package com.ophiux.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ophiux.common.core.constant.CommonConstants;
import com.ophiux.system.mapper.SysTenantMapper;
import com.ophiux.system.model.entity.SysTenant;
import com.ophiux.system.service.SysTenantService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 租户
 * mybatis-plus 3.4.3.3 特殊处理 https://github.com/baomidou/mybatis-plus/pull/3592
 */
@Service
@AllArgsConstructor
public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant> implements SysTenantService {

    @Override
    public List<SysTenant> getNormalTenant() {
        return this.baseMapper.selectList(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getStatus, CommonConstants.STATUS_NORMAL));
    }

}
